<template>
  <view>
    <!-- 条件编译小组件 -->
    <ifdef></ifdef>
    <swiper :indicator-dots="true" :autoplay="true" :interval="2000" :duration="1000" indicator-color="#f00" indicator-active-color="#ff0">
      <swiper-item>
        <view class="swiper-item"><image src="http://gw.alicdn.com/imgextra/i3/49/O1CN01jSeqZo1CEU05gye9r_!!49-0-lubanu.jpg" mode="widthFix"></image></view>
      </swiper-item>
      <swiper-item>
        <view class="swiper-item"><image src="http://gw.alicdn.com/imgextra/i3/93/O1CN01wMS0Q11CYdQa4dCQ7_!!93-0-lubanu.jpg" mode="widthFix"></image></view>
      </swiper-item>
      <swiper-item>
        <view class="swiper-item"><image src="http://gw.alicdn.com/imgextra/i2/122/O1CN01We6Gba1CluuiXVc8F_!!122-0-lubanu.jpg" mode="widthFix"></image></view>
      </swiper-item>
      <swiper-item>
        <view class="swiper-item"><image src="http://gw.alicdn.com/imgextra/i3/1638067/O1CN01WVhtcE29SjeobRiGF_!!1638067-0-lubanu.jpg" mode="widthFix"></image></view>
      </swiper-item>
    </swiper>
    <!-- #ifdef MP-WEIXIN -->
    <view class="kefu">
      <view>客服页面</view>
      <button type="primary" open-type="contact" @contact="contact">连接客服</button>
      <button type="primary" open-type="feedback">意见反馈</button>
    </view>
    <!-- #endif -->
  </view>
</template>

<script>
import ifdef from '../../components/ifdef/ifdef.vue';
export default {
  components: {
    ifdef
  },
  data() {
    return {};
  },
  methods: {
    contact: function(event) {
      console.log(event);
    }
  }
};
</script>

<style lang="less">
swiper {
  width: 100%;
  height: calc(750rpx * 352 / 1125);
  swiper-item {
    .swiper-item {
      > image {
        width: 100%;
      }
    }
  }
}
</style>
